﻿using System;

namespace Fast.ConfigureOptions
{
    /// <summary>
    /// 配置选项特性
    /// </summary>
    [SkipScan, AttributeUsage(AttributeTargets.Class)]
    public class ConfigureOptionsAttribute : Attribute
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public ConfigureOptionsAttribute()
        {
        }
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="jsonKey">appsetting.json 对应键</param>
        public ConfigureOptionsAttribute(string jsonKey = default, bool postConfigureAll = default)
        {
            JsonKey = jsonKey;
            PostConfigureAll = postConfigureAll;
        }
        /// <summary>
        /// 对应配置文件中的Key
        /// </summary>
        public string JsonKey { get; set; }
        /// <summary>
        /// 对所有配置实例进行后期配置
        /// </summary>
        public bool PostConfigureAll { get; set; }
    }
}
